<?php

# http://projects:8081/cdapp-2kt-api/api/_logfile.php
# http://projects:8081/cdapp-2kt-api/api/_logfile.php?test=1

$test = isset($_GET['test']) ? $_GET['test'] : 0;
if ($test) {
  logfile('TEST', 'This is a test.');
}

function logfile($title, $content) {
  $time = date("Y-m-d H:i:s");
  $file = '2KT-LOG-' . date("Ymd") . '.txt';
  file_put_contents("log/{$file}", "[{$time}][{$title}]\n{$content}\n\n", FILE_APPEND);
}
